#if($msg)
<script>
alert('$!msg');
</script>
#end
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>编辑文章</title>
<link href="/include/manage/images/main/style.css" rel="stylesheet" type="text/css" />
<link href="/include/manage/dialog/asyncbox.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="/ckeditor/ck_init.js"></script>
<script type="text/javascript" src="/include/manage/js/datepicker.js"></script>
<script type="text/javascript" src="/include/manage/js/jquery.js"></script>
<script type="text/javascript" src="/include/manage/js/AsyncBox.js"></script>
<script language="javascript">
jQuery.ajaxSetup ({  
	cache: false
});

jQuery(function(){
	jQuery('#gennews').click(function(){
		asyncbox.open({
			title : '生成文章',
			url : '/include/manage/generate_news.jsp?id=$!news.id',
			width : 400,
			height : 300,
			modal : true,
			tipsbar:{
				title : '生成文章静态文件',
				content : '注意：仅当使用网站静态化时，此功能才有效，生成过程中请不要关闭窗口'
				},
		　　btnsbar : jQuery.btn.OK,
		　　callback : function(action,iframe){
		　　　}
		});
	});
});

function checkForm(){
	jQuery("#Save")[0].enabled=false;
	var isok=true;
	if(jQuery("#title").val().length==0){
		alert("标题不能为空！");
		jQuery("#title")[0].focus();
		isok = false;
	}else if(jQuery("#link").val().length==0){
		alert("链接不能为空！");
		jQuery("#link")[0].focus();
		isok = false;
	}
	if(isok==true){
		jQuery("#writeform").submit();
	}
}
</script>
</head>
<body>
<form id="writeform" name="writeform" method="post" action="/manage_news.ad" enctype="multipart/form-data">
<input type="hidden" name="parameter" value="$!action" />
<input type="hidden" name="id" id="id" value="$!news.id" />
<input type="hidden" name="date" value="$!news.date" />
<input type="hidden" name="content" value="$!news.content" />
<input type="hidden" name="display" value="$!news.display" />
<input type="hidden" name="order" #if($news.order) value="$!news.order"#else value="0"#end />
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="30" background="/include/manage/images/main/tab_05.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="12" height="30"><img src="/include/manage/images/main/tab_03.gif" width="12" height="30" /></td>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="46%" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="5%"><div align="center"><img src="/include/manage/images/main/tb.gif" width="16" height="16" /></div></td>
                <td width="95%"><span class="STYLE3">当前位置</span>：[内容管理]-[编辑文章]</td>
              </tr>
            </table></td>
            <td width="54%">
            #if($action=="update")
            <table border="0" align="right" cellpadding="0" cellspacing="0">
              <tr>
                <td width="60"><table width="90%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><div align="center"><a href="/manage_news.ad?parameter=add&tid=#if($tid)$!tid#else$!news.type#end"><img src="/include/manage/images/main/22.gif" width="14" height="14" /></a></div></td>
                    <td><div align="center"><a href="/manage_news.ad?parameter=add&tid=#if($tid)$!tid#else$!news.type#end">新增</a></div></td>
                  </tr>
                </table></td>
                <td width="52"><table width="88%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><div align="center"><a href="/manage_news.ad?parameter=delete&id=$!news.id"><img src="/include/manage/images/main/11.gif" width="14" height="14" /></a></div></td>
                    <td><div align="center"><a href="/manage_news.ad?parameter=delete&id=$!news.id">删除</a></div></td>
                  </tr>
                </table></td>
              </tr>
            </table>
            #end
            </td>
          </tr>
        </table></td>
        <td width="16"><img src="/include/manage/images/main/tab_07.gif" width="16" height="30" /></td>
      </tr>
    </table></td>
  </tr>
  <tr>
  	<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="8" background="/include/manage/images/main/tab_12.gif">&nbsp;</td>
        <td>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="b5d6e6">
    <tr> 
      <td width="80" height="25" bgcolor="#ffffff">&nbsp;文章标题：</td>
      <td width="300" bgcolor="#ffffff">&nbsp;
      	<input id="title" name="title" type="text" value="$!news.title" size="30" />
      </td>
    </tr>
    <tr> 
 		<td height="25" bgcolor="#ffffff">&nbsp;文章频道：</td>
      <td bgcolor="#ffffff">&nbsp;
      	<select name="type" id="type">
          <option value="0">请选择频道...</option>
          #foreach ($type in $typeList)
          <option value="$type.id"
          #if($tid)
          	#if($type.id==$tid) selected#end
          #end
          #if($news.type)
          	#if($type.id==$news.type) selected#end  
          #end>$type.name</option>
          #end
        </select>
      </td>
    </tr>
    <tr> 
 		<td height="25" bgcolor="#ffffff">&nbsp;文章链接：</td>
      <td bgcolor="#ffffff">&nbsp;
      	<input id="link" name="link" type="text" value="$!news.link" size="30" />
      </td>
    </tr>
    <tr> 
 		<td height="25" bgcolor="#ffffff">&nbsp;</td>
      <td bgcolor="#ffffff">&nbsp;
      	<a href="/manage_news.ad?parameter=edit&id=$!news.link">点击这里编辑原文章</a>
      </td>
    </tr>
</table>
		</td>
        <td width="8" background="/include/manage/images/main/tab_15.gif">&nbsp;</td>
      </tr>
    </table></td>
    </tr>
  <tr>
    <td height="35" background="/include/manage/images/main/tab_19.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="12" height="35"><img src="/include/manage/images/main/tab_18.gif" width="12" height="35" /></td>
        <td valign="top"><div align="center">
		#if($pop==0)
        	<input id="Save" type="button" name="Save" value="保存" onClick="checkForm()"/>
        #elseif($pop==1)
        	<input id="Save" type="button" name="Save" value="审核" onClick="checkForm()"/>
		#else
			<input id="Save" type="button" name="Save" value="发布" onClick="checkForm()"/>
		#end
			&nbsp; &nbsp; 
		#if($action=="update")
			<input type="reset" name="Reset" value="重写"/>
		#else
			<input type="reset" name="Reset" value="清空"/>
		#end
		#if($pop==1)
			&nbsp; &nbsp; 
			<input type="button" name="Cancel" value="撤销" onClick="location.href='/manage_news.ad?parameter=noDisplay&id=$!news.id'"/>
		#end
		#if($action=="update")
			&nbsp; &nbsp; 
			<input type="button" id="Review" name="Review" value="预览" onClick="window.open('/news.do?parameter=preview&id=$!news.id')" />
			&nbsp; &nbsp; 
			#if($site.html==1)
			<input type="button" id="gennews" name="generate" value="生成"/>
			#end
		#end
        </div></td>
        <td width="16"><img src="/include/manage/images/main/tab_20.gif" width="16" height="35" /></td>
      </tr>
    </table>
	</td>
  </tr>
</table>
  </form>
</body>
</html>